import java.util.Scanner;

public class GCD {
    public static void main(String[] args){
        Scanner scanner=new Scanner(System.in);
        System.out.println("输入两个整数：");
        int num1=scanner.nextInt();
        int num2=scanner.nextInt();
        int gcd=findGCD(num1,num2);
        System.out.println("最大公约数是："+gcd);
    }

    public static int findGCD(int a, int b) {
        while (b != 0) {
            int temp = b;
            b = a % b;
            a = temp;
        }
        return a;
    }
}

